{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "2ac65c12",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "以下是针对大专一年级学生Git入门教学的详细指导方案及配套文档框架，包含系统化的教学设计和实用模板：\n",
      "\n",
      "---\n",
      "### **创意性标题**\n",
      "《从零玩转Git：版本控制第一课——代码时光机初体验》\n",
      "\n",
      "---\n",
      "\n",
      "### **一、教学大纲设计**\n",
      "\n",
      "#### **1. 课程基本信息**\n",
      "- 课程名称：Git版本控制基础\n",
      "- 课时：2课时（90分钟）\n",
      "- 教学目标：\n",
      "  - 认知目标：理解版本控制概念与Git核心原理\n",
      "  - 技能目标：掌握Git基础操作（init/add/commit/push/pull）\n",
      "  - 情感目标：激发学生对协作开发的兴趣\n",
      "\n",
      "#### **2. 分层教学重点**\n",
      "```markdown\n",
      "| 层级 | 内容要点                  | 学生活动设计          |\n",
      "|------|---------------------------|-----------------------|\n",
      "| 基础 | Git安装与仓库创建         | 跟随演示操作          |\n",
      "| 进阶 | 提交历史与分支概念        | 小组讨论+流程图绘制   |\n",
      "| 拓展 | GitHub远程协作初体验      | 模拟团队提交冲突解决  |\n",
      "```\n",
      "\n",
      "---\n",
      "\n",
      "### **二、教学文档模板**\n",
      "\n",
      "#### **1. 授课PPT框架（节选）**\n",
      "```markdown\n",
      "1. 封面页\n",
      "   - 标题+Git吉祥物Octocat图片\n",
      "   - 课程口号：\"让代码有迹可循\"\n",
      "\n",
      "2. 情景导入（5分钟）\n",
      "   - 对比案例：\n",
      "     - 无版本控制：论文终稿_final_reallyfinal.docx\n",
      "     - 有Git：清晰的提交历史树\n",
      "\n",
      "3. 核心知识页（可视化设计）\n",
      "   - Git工作区/暂存区/仓库关系图\n",
      "   - 命令速记卡：\n",
      "     ▸ git init    # 启动时光机\n",
      "     ▸ git add     # 打包时间胶囊\n",
      "     ▸ git commit  # 封存历史时刻\n",
      "```\n",
      "\n",
      "#### **2. 说课文稿要点**\n",
      "```markdown\n",
      "【学情分析】 \n",
      "学生具备基础编程能力但无分布式系统概念，需规避以下误区：\n",
      "- 将Git等同于网盘备份\n",
      "- 混淆commit与push的区别\n",
      "\n",
      "【教法设计】\n",
      "采用\"外科手术式\"教学法：\n",
      "1. 演示：教师现场构建\"作业提交系统\"仓库\n",
      "2. 模仿：学生复现教师操作路径\n",
      "3. 变异：故意制造冲突场景（如同时修改README）\n",
      "```\n",
      "\n",
      "#### **3. 实训案例设计**\n",
      "**案例1：个人日记管理系统**\n",
      "```bash\n",
      "# 任务流程\n",
      "1. mkdir my_diary && cd my_diary\n",
      "2. 创建2023-09-01.txt并写入内容\n",
      "3. 完成首次提交\n",
      "4. 修改文件后创建新版本\n",
      "5. 使用git diff查看变更\n",
      "```\n",
      "\n",
      "**案例2：小组协作开发（角色扮演）**\n",
      "```markdown\n",
      "| 角色   | 任务                   | Git操作重点          |\n",
      "|--------|------------------------|----------------------|\n",
      "| 组长   | 创建仓库并添加协作者    | git remote add       |\n",
      "| 组员A  | 开发登录模块            | git pull --rebase    |\n",
      "| 组员B  | 修改同一文件引发冲突    | git mergetool        |\n",
      "```\n",
      "\n",
      "---\n",
      "\n",
      "### **三、课堂实施策略**\n",
      "\n",
      "#### **1. 渐进式教学节奏**\n",
      "```mermaid\n",
      "graph TD\n",
      "    A[10min 概念讲解] --> B[15min 演示操作]\n",
      "    B --> C[20min 跟练环节]\n",
      "    C --> D[25min 项目实战]\n",
      "    D --> E[15min 故障诊所]\n",
      "    E --> F[5min 总结升华]\n",
      "```\n",
      "\n",
      "#### **2. 常见问题应急预案**\n",
      "- **学生困惑点预判：**\n",
      "  - 问：为什么需要先add再commit？\n",
      "  - 答：类比快递流程（打包->发货）\n",
      "  \n",
      "- **技术故障处理：**\n",
      "  - 备用方案：使用Web版GitPod环境\n",
      "  - 快速恢复：提供预制仓库.zip包\n",
      "\n",
      "---\n",
      "\n",
      "### **四、评估与拓展**\n",
      "\n",
      "#### **1. 课堂检验方法**\n",
      "- 形成性评估：通过`git log --graph`输出评分\n",
      "- 趣味挑战：\n",
      "  - 找回被误删的提交（git reflog）\n",
      "  - 创作最有趣的commit message\n",
      "\n",
      "#### **2. 课后拓展资源**\n",
      "- 可视化学习平台：learngitbranching.js.org\n",
      "- 情景化练习：GitHub的\"first-contributions\"项目\n",
      "\n",
      "---\n",
      "\n",
      "### **文档下载包结构**\n",
      "```\n",
      "├── 教学PPT（动态版）.pptx\n",
      "├── 教师手册（含故障树）.pdf\n",
      "├── 学生实验指导书.docx\n",
      "└── 资源包/\n",
      "    ├── 标准仓库模板/\n",
      "    ├── 常见错误截图集/\n",
      "    └── 速查备忘录.png\n",
      "```\n",
      "\n",
      "通过将抽象概念具象化为\"代码时光机\"的比喻，配合强交互的实训设计，可有效降低学习曲线。建议首次课聚焦本地操作，待学生建立肌肉记忆后再引入远程仓库概念。\n"
     ]
    }
   ],
   "source": [
    "from openai import OpenAI\n",
    "\n",
    "client = OpenAI(\n",
    "    base_url=\"https://api.deepseek.com/\",\n",
    "    api_key=\"sk-8d503c4610fa4d9ba03a513ec9ecd24b\"\n",
    ")\n",
    "\n",
    "completion = client.chat.completions.create(\n",
    "    model=\"deepseek-chat\",\n",
    "    messages=[\n",
    "        {\n",
    "                \"role\": \"system\",\n",
    "                # 这里写系统提示词，规定Ai输出的整体要求\n",
    "                \"content\": \"你是一位文本大纲生成专家，擅长根据用户的需求创建一个有条理且易于扩展成完整文章的大纲，你拥有强大的主题分析能力，能准确提取关键信息和核心要点。具备丰富的文案写作知识储备，熟悉各种文体和题材的文案大纲构建方法。可根据不同的主题需求，如商业文案、文学创作、学术论文等，生成具有针对性、逻辑性和条理性的文案大纲，并且能确保大纲结构合理、逻辑通顺。该大纲应该包含以下部分：\\n引言：介绍主题背景，阐述撰写目的，并吸引读者兴趣。\\n主体部分：第一段落：详细说明第一个关键点或论据，支持观点并引用相关数据或案例。\\n第二段落：深入探讨第二个重点，继续论证或展开叙述，保持内容的连贯性和深度。\\n第三段落：如果有必要，进一步讨论其他重要方面，或者提供不同的视角和证据。\\n结论：总结所有要点，重申主要观点，并给出有力的结尾陈述，可以是呼吁行动、提出展望或其他形式的收尾。\\n创意性标题：为文章构思一个引人注目的标题，确保它既反映了文章的核心内容又能激发读者的好奇心。\"\n",
    "        },\n",
    "        {\n",
    "                \"role\": \"user\",\n",
    "                # 这里写用户提示词，添加更具体的要求。\n",
    "                \"content\": \"我是一名教师，需要教授大专第一年的学生学习Git的相关知识与应用技能，课前需要充分准备教案、授课计划、授课PPT、说课文稿、场景预设、案例展示等文档资料；现在面临第一堂授课，请辅助我完成教学任务，给出详细且系统化的指导意见，提供文档资料样例\"\n",
    "        }\n",
    "    ]\n",
    ")\n",
    "\n",
    "print(completion.choices[0].message.content)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4771a497",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "正在分析文件夹: C:\\Users\\GOCZ\\AppData\n"
     ]
    },
    {
     "ename": "PermissionError",
     "evalue": "[WinError 5] 拒绝访问。: 'C:\\\\Users\\\\GOCZ\\\\AppData\\\\Local\\\\Application Data'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mPermissionError\u001b[0m                           Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[3], line 62\u001b[0m\n\u001b[0;32m     60\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m     61\u001b[0m     \u001b[38;5;28mprint\u001b[39m(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[38;5;124m正在分析文件夹: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mtarget_folder\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m---> 62\u001b[0m     results \u001b[38;5;241m=\u001b[39m \u001b[43manalyze_folder\u001b[49m\u001b[43m(\u001b[49m\u001b[43mtarget_folder\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m     63\u001b[0m     print_results(results)\n\u001b[0;32m     64\u001b[0m     total_size \u001b[38;5;241m=\u001b[39m \u001b[38;5;28msum\u001b[39m(item[\u001b[38;5;241m1\u001b[39m] \u001b[38;5;28;01mfor\u001b[39;00m item \u001b[38;5;129;01min\u001b[39;00m results)\n",
      "Cell \u001b[1;32mIn[3], line 38\u001b[0m, in \u001b[0;36manalyze_folder\u001b[1;34m(folder_path)\u001b[0m\n\u001b[0;32m     36\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m item \u001b[38;5;129;01min\u001b[39;00m folder_path\u001b[38;5;241m.\u001b[39miterdir():\n\u001b[0;32m     37\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m item\u001b[38;5;241m.\u001b[39mis_dir():\n\u001b[1;32m---> 38\u001b[0m         size \u001b[38;5;241m=\u001b[39m \u001b[43mget_size\u001b[49m\u001b[43m(\u001b[49m\u001b[43mitem\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m     39\u001b[0m         results\u001b[38;5;241m.\u001b[39mappend((\u001b[38;5;28mstr\u001b[39m(item), size, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfolder\u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[0;32m     41\u001b[0m \u001b[38;5;66;03m# 按大小降序排序\u001b[39;00m\n",
      "Cell \u001b[1;32mIn[3], line 13\u001b[0m, in \u001b[0;36mget_size\u001b[1;34m(path)\u001b[0m\n\u001b[0;32m     11\u001b[0m         total \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m entry\u001b[38;5;241m.\u001b[39mstat()\u001b[38;5;241m.\u001b[39mst_size\n\u001b[0;32m     12\u001b[0m     \u001b[38;5;28;01melif\u001b[39;00m entry\u001b[38;5;241m.\u001b[39mis_dir():\n\u001b[1;32m---> 13\u001b[0m         total \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[43mget_size\u001b[49m\u001b[43m(\u001b[49m\u001b[43mentry\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpath\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m     14\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m total\n",
      "Cell \u001b[1;32mIn[3], line 9\u001b[0m, in \u001b[0;36mget_size\u001b[1;34m(path)\u001b[0m\n\u001b[0;32m      7\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m os\u001b[38;5;241m.\u001b[39mpath\u001b[38;5;241m.\u001b[39mgetsize(path)\n\u001b[0;32m      8\u001b[0m total \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m----> 9\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m entry \u001b[38;5;129;01min\u001b[39;00m \u001b[43mos\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mscandir\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpath\u001b[49m\u001b[43m)\u001b[49m:\n\u001b[0;32m     10\u001b[0m     \u001b[38;5;28;01mif\u001b[39;00m entry\u001b[38;5;241m.\u001b[39mis_file():\n\u001b[0;32m     11\u001b[0m         total \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m entry\u001b[38;5;241m.\u001b[39mstat()\u001b[38;5;241m.\u001b[39mst_size\n",
      "\u001b[1;31mPermissionError\u001b[0m: [WinError 5] 拒绝访问。: 'C:\\\\Users\\\\GOCZ\\\\AppData\\\\Local\\\\Application Data'"
     ]
    }
   ],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "lanqiao386",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.18"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
